<script type="text/javascript" src="wysiwyg/wysiwyg.js"></script>
<div id="information">
<br /><br />
<form method="post" action="addarticle.php" class="form" name="myform" id="myform">
   <h3 class="form_h3">Име на статията</h3>
   <input type="text" name="article_name" value="<?php echo $_POST['article_name']; ?>" />
   <h3 class="form_h3">Описание на статията</h3>
   <textarea cols="50" rows="5" name="descr"><?php echo $_POST['descr']; ?></textarea><br /><br />
   <h3 class="form_h3">Статия</h3>
   <div id="wysiwyg_cp" style="padding: 8px; width: 690px; margin-left: 0px;">
      <input type="button" onclick="iBold()" style="background-image: url('img/bold.png'); width: 25px; height: 25px; border: none;"/>
	  <input type="button" onclick="iUnderline()" style="background-image: url('img/underline.png'); width: 25px; height: 25px; border: none"/>
	  <input type="button" onclick="iItalic()" style="background-image: url('img/italic.png'); width: 25px; height: 25px; border: none"/> 
	  <input type="button" onclick="iLeft()" style="background-image: url('img/left.png'); width: 25px; height: 25px; border: none"/>
	  <input type="button" onclick="iCenter()" style="background-image: url('img/center.png'); width: 25px; height: 25px; border: none"/>
	  <input type="button" onclick="iRight()" style="background-image: url('img/right.png'); width: 25px; height: 25px; border: none"/> 
	  <input type="button" onclick="iSb()" style="background-image: url('img/sub.png'); width: 25px; height: 25px; border: none"/>
	  <input type="button" onclick="iSp()" style="background-image: url('img/sup.png'); width: 25px; height: 25px; border: none"/> 
	  <input type="button" onclick="iFontSize()" style="background-image: url('img/textsize.png'); width: 25px; height: 25px; border: none"/>
	  <input type="button" onclick="iForeColor()" style="background-image: url('img/textcolor.png'); width: 25px; height: 25px; border: none"/> 
	  <input type="button" onclick="iImage()" style="background-image: url('img/img.png'); width: 25px; height: 25px; border: none"/>
    </div>
	<textarea name="myTextArea" id="myTextArea" cols="100" rows="14" style="height: 150px; width: 380px; display: none;"></textarea>
    <iframe name="richTextField" id="richTextField" style="width: 500px; height: 500px;border-radius: 5px;-moz-border-radius: 5px;background-color: #e4dcdc;color: #4d4a4a;margin-left: 5px;border: 1px solid #bbbbbb;color: gray;"></iframe><br />
   <h3 class="form_h3">Раздел</h3>
   <select name="module">
      <?php
	     //Select the tutorial name
	     $sel_u = mysql_query('SELECT teacher_to FROM users WHERE username="'.$_SESSION['username'].'"');
		 $row_u = mysql_fetch_assoc($sel_u);
		 
		 //Select the modules from the tutorial
	     $sel_m = mysql_query('SELECT name FROM modules WHERE to_tutorial = "'.$row_u['teacher_to'].'"');
		 while($row_m = mysql_fetch_assoc($sel_m)){
		 ?>
		    <option value="<?php echo $row_m['name']; ?>"><?php echo $row_m['name']; ?></option>
		 <?php
		 }
	  ?>
   </select><br /><br />
   <input type="hidden" name="hide" value="2" />
   <input type="button" name="myBtn" value="Качи статията" onclick="javascript: submit_form();"/>
</form>
<?php
   include "../php/addarticle.php";
?>
</div>